package qc.module.demo.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import qc.module.demo.dto.river.RIVERDto;
import qc.module.demo.entity.RIVER;

import java.util.List;

/**
 * RIVERMapper
 *
 * @author QuCheng Tech
 * @since 2023/9/19
 */
@Mapper
public interface RIVERMapper {
    RIVERMapper MAPPER = Mappers.getMapper(RIVERMapper.class);

    @Mapping(target = "TM", ignore = true)
    RIVER toEntity(RIVERDto dto);

    @Mapping(target = "TM", source = "TM", dateFormat = "yyyy-MM-dd HH:mm:ss")
    RIVERDto toDto(RIVER en);

    List<RIVERDto> toDtoList(List<RIVER> enList);
}
